1. Technical Field
The present invention relates generally to computer software and, more specifically, to methods of recording events in Java.
2. Description of Related Art
The evolution of programming languages has, to a great extent, been driven by changes in the hardware being programmed. As hardware has grown faster, cheaper, and more powerful, software has become larger and more complex. The migration from assembly languages to procedural languages, such as C, and to object-oriented languages, such as C++ and Java, was largely driven by a need to manage ever greater complexityxe2x80x94complexity made possible by increasingly powerful hardware.
Today, the progression toward cheaper, faster, and more powerful hardware continues, as does the need for managing increasing software complexity. Building on C and C++, Java helps programmers deal with complexity by rendering impossible certain kinds of bugs that frequently plague C and C++ programmers.
In addition to the increasing capabilities of hardware, there is another fundamental shift taking place that impacts upon software programming, that is the network. As networks interconnect more and more computers and devices, new demands are being placed on software. One of these demands is platform independence.
Java supports platform independence primarily through the creation of the Java Virtual Machine. The Java Virtual Machine is an abstract computer, and its specification defines certain features every Java Virtual Machine must have. However, the specification for the Java Virtual Machine is flexible, enabling it to be implemented on a wide variety of computers, devices, and operating systems. One of the main tasks performed by a Java Virtual Machine is to load class files and execute the bytecodes they contain.
One type of program executed by a Java Virtual Machine is an applet. An applet is a Java program that has a set of standard properties that are defined by the applet class. This class was developed by Sun Microsystems and is included in the standard Java Software Development Kit (Java SDK).
Although, theoretically, a program written in Java for one platform should perform on any Java enabled platform, given the allowable differences among Java platform implementations and other factors, a Java program or applet should be tested on all platforms on which it is anticipated to perform. Since user actions in Java are handled by events, and since it can sometimes take many hours or days for a problem to manifest itself, testing of the entire Java Virtual Machine on a platform can be very tedious. Therefore, it is desirable to provide methods of automating the functional testing of the Java platform on various systems.
However, current methods of automating testing of the Java platform on various systems requires a specialized execution environment, as well as compilation of a separate program. Furthermore, current methods require that the applet or application must be exited before any automation can take place, and they require a significant amount of system resources. Therefore, there is a need for a simpler method of testing the Java platform, that does not require recompilation of code, that does not require the applet or application to be exited before automation, and that uses fewer system resources.
The present invention provides a data processor implemented method for recording events in Java. According to a preferred embodiment, an automator is attached to a Java applet. Responsive to selection by a user, listeners are added for each event type produced in the Java applet. Each time a specified event occurs, that event is captured and saved to a data structure. The recording of events is performed until the user stops the process.